import Vue from 'vue'
import VueRouter from 'vue-router'
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
	return originalPush.call(this, location).catch((err) => err)
}


Vue.use(VueRouter)

const Front = ()=> import('views/front/mian/Mian.vue')
const Admin = ()=> import('views/admin/adminMain/AdminMain.vue')
const AdminLogin = ()=> import('../views/adminLogin/Adminlogin.vue')

import HomeCHild   from './front.js'
import adminCHild   from './admin.js'

const routes = [
	{
    path: '/',
    redirect:'/front'
	},
	{
		path: '/admin', 
    component: Admin,
    children:adminCHild
  },
  {
		path: '/front',
    component: Front,
    children:HomeCHild
  }
  ,
  {
		path: '/adminLogin',
    component: AdminLogin,
    // children:HomeCHild
	}
]

const router = new VueRouter({
	routes,
})

export default router
